-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise RuntimeWarning
if jax > 0.4.28 is installed
#6864
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6864 +/- ##
=======================================
Coverage 99.59% 99.59%
=======================================
Files 480 480
Lines 45409 45421 +12
=======================================
+ Hits 45224 45236 +12
Misses 185 185 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why are we not validating if someone specifies interface="jax"
? Or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🎉
Jax is not compatible with pennylane for versions > 0.4.28 (confirmed by the test logs of this PR). This PR raises a
RuntimeWarning
if version > 0.4.28 is installed:QNode.__init__
if the specified interface resolves toJAX
orJAX_JIT
execute
if the original interface was"auto"
orNone
and the resolved interface isJAX
orJAX_JIT
. I don't raise a warning if the original interface was jax/jax-jit because if that is the case,QNode.__init__
should've already raised a warning._validate_jax_version
private kwarg toqml.math.get_canonical_interface_name
, which is called byQNode.__init__
, andqml.workflow.resolution._resolve_interface
(used byqml.execute
), so that both those entry points can raise warnings if appropriate.Possible drawbacks:
None. The only annoying is that our CI uses supported versions of jax, so we can't get coverage for the runtime warning. I've added a
# pragma: no cover
to work around this, but I'm not particularly happy about it.[sc-82570]